<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>

<%@ taglib uri="/WEB-INF/hexacta.tld" prefix="hexacta"%>

<head>
	<sx:head cache="true" />
	<link rel="stylesheet" href="/hrs-intranet/styles/errortag.css" type="text/css" />
	<link rel="stylesheet" href="/hrs-intranet/styles/TabContainerLocal.css" type="text/css" />
	<link rel="stylesheet" href="/hrs-intranet/styles/displaytag.css" type="text/css" />
	<link rel="stylesheet" type="text/css" href="/hrs-intranet/styles/jsgantt.css" />
</head>

<s:include value="errorsSection.jsp"></s:include>

<script type="text/javascript">
</script>

<br>
<s:form cssClass="formClass">
	<s:label name="message" />
	<s:if test="!alreadyCreated && !periodOpen">
		<s:submit key="Create" cssClass="btn" id="createbtn" action="FeedbackPeriodsAction_create"
			cssStyle="position:relative; top:5px;" />
	</s:if>
	<s:if test="canPersist">
		<s:submit key="Persist" cssClass="btn" id="createbtn" action="FeedbackPeriodsAction_persist"
			cssStyle="position:relative; top:5px;" />
	</s:if>
</s:form>

<br><br>

<h2>Existing feedback periods</h2>
<s:form id="feedbacksPeriodsForm" name="feedbacksPeriodsForm"  >
	<display:table id="feedbackPeriodsList"
		name="feedbackPeriods" defaultsort="1"
		defaultorder="ascending"
		requestURI="FeedbackPeriodsAction_listFeedbackPeriods"
		class="listable" cellpadding="0" cellspacing="0"
		pagesize="10">
		<display:column paramId="period" property="period" title="Period" sortable="false" />
		<display:column property="numberOfEmployees" title="Number of employees" sortable="false" />
		<display:column title="Close feedbacks" sortable="false" >
			<s:url action="ManageFeedbacksRolesAction" var="ManageFeedbacksRolesAction">
 				<s:param name="periodId" >
 				<s:property value="%{#attr.feedbackPeriodsList.period}" />
 				</s:param>  
			</s:url>
			<s:a href="%{ManageFeedbacksRolesAction}" value="ManageFeedbacksRolesAction">Closed Feedbacks</s:a>
		</display:column>
		<s:if test="%{hasPermission(permissionNameConverter.getAnalyzeFeedbackPermission())}" >
			<display:column title="Control Panel" sortable="false" >
				<s:url action="FeedbackControlPanelAction_listFeedbackPeriods" var="FeedbackControlPanelAction_listFeedbackPeriods">
					<s:param name="period" >
	 				<s:property value="%{#attr.feedbackPeriodsList.period}" />
	 				</s:param>
	 			</s:url>
	 			<s:a href="%{FeedbackControlPanelAction_listFeedbackPeriods}" value="FeedbackControlPanelAction_listFeedbackPeriods">Dashboard</s:a>
			</display:column>
		</s:if>
		<display:column title="Employee Summary" sortable="false" >
			<s:url action="EmployeeFeedbackSummaryAction" var="EmployeeFeedbackSummaryAction">
 				<s:param name="periodId" >
 				<s:property value="%{#attr.feedbackPeriodsList.period}" />
 				</s:param>  
			</s:url>
			<s:a href="%{EmployeeFeedbackSummaryAction}" value="EmployeeFeedbackSummaryAction">Employee Summary</s:a>
		</display:column>
		<display:column title="Manage Feedbacks" sortable="false" >
			<s:url action="ManageFeedbacksAction" var="ManageFeedbacksAction">
 				<s:param name="periodId" >
 				<s:property value="%{#attr.feedbackPeriodsList.period}" />
 				</s:param>  
			</s:url>
			<s:a href="%{ManageFeedbacksAction}" value="ManageFeedbacksAction">Manage Feedbacks</s:a>
		</display:column>
		
		<display:column title="Mentors Report" sortable="false" >
			<s:url action="MentorsHistoricReportAction" var="MentorsHistoricReportAction">
 				<s:param name="periodId" >
 				<s:property value="%{#attr.feedbackPeriodsList.period}" />
 				</s:param>  
			</s:url>
			<s:a href="%{MentorsHistoricReportAction}" value="MentorsHistoricReportAction">Mentors Report</s:a>
		</display:column>
		
		<display:column title="Final results" sortable="false" >
			<s:url action="FeedbackFinalResultsAction_initFilters" var="FeedbackFinalResultsAction_initFilters">
				<s:param name="filters.period" >
 				<s:property value="%{#attr.feedbackPeriodsList.period}" />
 				</s:param>
 			</s:url>
 			<s:a href="%{FeedbackFinalResultsAction_initFilters}" value="FeedbackFinalResultsAction_initFilters">Final results</s:a>
		</display:column>
</display:table>
</s:form>